<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TemplateWeb.Models.ViewModels.GroupViewModel>" %>
<%@ Import Namespace="TemplateWeb.Helpers" %>
<div class="AdminPageText">
List Of VanHoaXaHoi
</div>
<% using (Ajax.BeginForm("UpdateVanHoaXaHoi", "Admin", new AjaxOptions { HttpMethod = "Post", UpdateTargetId = "PartialDiv" })){ %>
<table class="Grid" cellpadding="0" cellspacing="0">
	<thead>
		<tr>
			<th>GanTruongMauGiao</th>
			<th>GanTruongCap1</th>
			<th>GanTruongCap2</th>
			<th>GanTruongCap3</th>
			<th>GanTruongDHCD</th>
			<th>GanTrungTamThuongMai</th>
			<th>KhuDanTriCao</th>
			<th>GanCho</th>
			<th>GanCongVien</th>
			<th>GanBenhVien</th>
			<th>GanTrungTamGiaiTri</th>
			<th>TienKinhDoanh</th>
			<th></th>
			<th></th>
		<tr>
	</thead>
	<% for (int i=0; i<Model.VanHoaXaHoiModel.GetModel.LstObjModel.Count; i++){
		if (i % 2 != 0) {%>
		<tr class="Row" id="row-<%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat %>">
		<% }
		else { %>
		<tr class="AlternatingRow" id="row-<%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat %>">
		<% } %>
		<% if (Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat == Model.VanHoaXaHoiModel.EditModel.ID){ %>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTruongMauGiao", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongMauGiao)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTruongCap1", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongCap1)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTruongCap2", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongCap2)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTruongCap3", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongCap3)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTruongDHCD", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongDHCD)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTrungTamThuongMai", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTrungTamThuongMai)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_KhuDanTriCao", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].KhuDanTriCao)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanCho", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanCho)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanCongVien", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanCongVien)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanBenhVien", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanBenhVien)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_GanTrungTamGiaiTri", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTrungTamGiaiTri)%>
			</td>
			<td>
				<%= Html.TextBox("VanHoaXaHoi_TienKinhDoanh", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].TienKinhDoanh)%>
			</td>
			<td>
				<a href="#" onclick="submitForm(event)">
					<span style="color: Blue; text-decoration: underline">Update</span>
				</a>
				&nbsp;
				<%= Html.Hidden("VanHoaXaHoi_CurrentPage", Model.VanHoaXaHoiModel.GetModel.CurrentPage) %>
				<%= Html.Hidden("VanHoaXaHoi_IDNhaDat", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat)%>
				<%= Html.Hidden("VanHoaXaHoi_IDNhaDat", Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat) %>
				<%= Ajax.ActionLink("Cancel", "CancelEditingVanHoaXaHoi", "Admin", new { page = Model.VanHoaXaHoiModel.GetModel.CurrentPage }, new AjaxOptions { UpdateTargetId = "PartialDiv" })%>
			</td>
			<td>
				<%= Ajax.ActionLink("Delete", "DeleteVanHoaXaHoi", "Admin", new { id = Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat }, new AjaxOptions{Confirm = "Are you sure you want to Delete it? This action cannot be undone.", HttpMethod = "Delete", OnComplete = "jsonDelete_OnComplete"})%>
			</td>
		<% }else{ %>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongMauGiao %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongCap1 %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongCap2 %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongCap3 %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTruongDHCD %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTrungTamThuongMai %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].KhuDanTriCao %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanCho %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanCongVien %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanBenhVien %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].GanTrungTamGiaiTri %></td>
			<td><%= Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].TienKinhDoanh %></td>
			<td>
				<%= Ajax.ActionLink("Edit", "EditVanHoaXaHoi", "Admin", new { page = Model.VanHoaXaHoiModel.GetModel.CurrentPage, id = Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat }, new AjaxOptions { UpdateTargetId = "PartialDiv" })%>
			</td>
			<td>
				<%= Ajax.ActionLink("Delete", "DeleteVanHoaXaHoi", "Admin", new { id = Model.VanHoaXaHoiModel.GetModel.LstObjModel[i].IDNhaDat }, new AjaxOptions{Confirm = "Are you sure you want to Delete it? This action cannot be undone.", HttpMethod = "Delete", OnComplete = "jsonDelete_OnComplete"})%>
			</td>
		<% } %>
		</tr>
	<% } %>  
</table>
<% } %>
<% GridPagerProperties properties = new GridPagerProperties()
	{
		PageSize = WebConfiguration.ProductsPerPage,
		RecordCount = Model.VanHoaXaHoiModel.GetModel.TotalItem,
		CurrentPageIndex = Model.VanHoaXaHoiModel.GetModel.CurrentPage,
		Controller = "Admin",
		ActionName = "SelectVanHoaXaHoi",
		UpdateTargetId = "PartialDiv"
	};
%>
<%= Ajax.GridPager(properties)%>
